[Mac] 開發環境建構 2024.May
過去重灌電腦最麻煩的就是還原設定檔, 雖然 Mac 有 TimeMachine 可無痛轉移, 但個人癖好還是喜歡重新檢視與安裝設定. 但越來越多軟體可以把配置設定存在雲端, 不但保持多台電腦間的同步, 重灌也只需登入帳號就可還原配置, 個人以為比 TimeMachine 方便.
但仍有些開發或 CLI 工具, 是將配置檔存放於家目錄下的隱藏檔 (.files), 無法透過雲端同步. 我是把這些檔案搬移到 Dropbox 資料夾下, 再建立 Symbolic Link, 如此就可透過 Dropbox 來同步設定檔.
現在重灌電腦要安裝設定環境, 僅需透過 shell script 安裝軟體與建立 Symbolic Link, 相當無痛.
CLI Environment
iTerm2
brew install iterm2
zsh and oh-my-zsh
macOS Mojave (10.14.x) 開始內建 zsh, 而 Catalina (10.15.x) 以後預設 Shell 改為 zsh.
在 macOS Mojave 系統要把預設 shell 改為 zsh 以及配置 zsh 最方便也推薦的方式就是透過 Oh My Zsh
Oh My Zsh
macOS Mojave 以後已經內建 Zsh, 所以直接安裝 Oh My Zsh 即可.
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
brew install zsh-completion
Powerline Font
brew install font-fira-code-nerd-font font-fira-code font-fira-mono font-fira-sans
brew install font-source-code-pro
brew install font-hack-nerd-font
Base Environment
Docker runtime
- OrbStack Personal, non-commercial use
- Docker Desktop Personal, non-commercial use
- Docker CLI on macOS
Brew formulae
brew install git tig zsh-completion tmux ncdu htop lesspipe sshtrix tldr diff-so-fancy fd ripgrep rclone thefuck ag svn moreutils asdf
See Also: Awesome CLI
Program Language
Node.js
Installing Node.js or io.js with nvm
NVM Manual install
git clone https://github.com/creationix/nvm.git ~/.nvm && cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`
cat ". ~/.nvm/nvm.sh" >> .bashrc
Install node.js
nvm install v8.11.1
nvm alias default tls
nvm use default
Go
brew install go
IDE & GUI Tools
VSCode
brew install --cask visual-studio-code
GoLand
brew install --cask goland
WebStorm
brew install --cask webstorm
Others
Fork - a fast and friendly git client for Mac
brew install fork
The Collaboration Platform for API Development.
brew install bruno
See Also: Postman Alternative
Sequel Pro is a fast, easy-to-use Mac database management application for working with MySQL databases.
brew install sequel-pro
Modern, Native Tool for Database Management.
brew install tableplus
Redis GUI management tool for Windows, Mac OS X, Ubuntu and Debian.
brew install --cask another-redis-desktop-manager
Robo 3T. Free, open-source MongoDB GUI
brew install tableplus
See Also
遺珠
以下是曾為個人熱愛, 但因故越來越少用的軟體. 暫列於此...
- Atom
A hackable text editor for the 21st Century by github. - SourceTree
Free Mercurial and Git Client for Windows and Mac - GitKraken
The downright luxurious Git client, for Windows, Mac & Linux - HyperTerm JS/HTML/CSS Terminal
- alacritty/alacritty: A cross-platform, OpenGL terminal emulator.
Reference
Zsh
- 让你的 Mac 提前用上 macOS Catalina 的 Shell——Oh My Zsh 配置指南 - 少数派
- bash to zsh 設定流程. 參考這篇一步一步執行,因為我已裝過 homebrew以及 iterm2… | by Youngmi huang | Medium
iTerm2 + Oh My Zsh
- [Tool] Mac + iTerm 2 + Oh My Zsh + Powerlevel9k 設定 - iT 邦幫忙::一起幫忙解決難題,拯救 IT 人的一天
- 超簡單!十分鐘打造漂亮又好用的 zsh command line 環境 | by Gary Chu | 財報狗技術部落格 | Medium
- 用Oh My Zsh把iTerm變美美. 使用終端機操作時常密密麻麻的,看一兩個小時還好,但如果長期這樣下去真的會眼殘,畫… | by Hazel Wu | Medium
- 看膩了一成不變的小黑窗?改用iterm2 + oh-my-zsh吧 | by Nathan Chou | Medium
WebStorm
Mac Dev